<ion-view id="tab-orders-view" hide-nav-bar="true" view-title="订单" wf-tab>

  <ion-header-bar align-title="center" class="bar-calm">
    <h1 class="title">订单</h1>
  </ion-header-bar>

  <ion-content>
    <div class="bar bar-header item-input-inset">
      <label id="searchLabel" class="item-input-wrapper">
        <i class="icon ion-ios-search placeholder-icon" style="font-size: 20px"></i>
        <input type="search" placeholder="请输入查询商品的订单编号" ng-model="searchData.words" ng-change="doSearch()">
      </label>
      <button ng-hide="!searchData.words" ng-click="clear()" class="wf-icon clean"></button>
    </div>
    <swiper-x items="orderStatus"></swiper-x>

    <ion-refresher
      pulling-text="下拉刷新..."
      on-refresh="doRefresh()">
    </ion-refresher>

    <div class="no-order" style="text-align: center" ng-if="$storage.orders.length == 0">
        <img src="img/tab-orders/nothing.png">
        <div class="no-order-notify"><b>您没有相关的订单</b></div>
        <div class="no-order-ad">可以去了解优品库商品</div>
        <button class="button button-stable" ng-click="goYPK()">随便看看</button>
    </div>

    <div class="order-container" ng-repeat="data in $storage.orders" ng-click="goOrderDetail(data)">
      <div class="header-container">
        <span ng-class="{true:'isypk',false:'notypk'}[data.isupk=='1']">订单号:&nbsp;{{data.orderNo}}</span>
        <!--<span class="right">{{data.orderStatus}}</span>-->
      </div>
      <div class="body-container" >
        <div class="item-container">
          <img ng-src="{{data.img}}" alt=""/>
        </div>
        <div class="content-container">
          <div class="line" style="margin-top: 20px;">
            <span style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{data.title}}</span><span style="float:right ;">x&nbsp;{{data.count}}</span>
          </div>
          <div class="line" style="font-size: 14px;white-space: nowrap;margin-top:60px">
            <span style="color: #ff0000;margin-right: 3px;"><span style="margin-right: 3px;">单价</span>¥{{data.price}}</span><span style="margin-left:6px;color:#999;">库存&nbsp;{{data.stock}}</span>
            <span style="float:right ;color: #ff0000;">运费&nbsp;￥{{data.sendmoney}}</span>
          </div>
        </div>
      </div>
      <div class="footer-container">
        <span class="left">{{data.paytype}}&nbsp;-&nbsp;{{data.orderStatus}}</span>
        <div class="right">
            总金额:¥{{data.totalAmt}}
        </div>

      </div>
    </div>
    <ion-infinite-scroll
        ng-if="canLoadMore()"
        distance="1%"
        immediate-check=false
        on-infinite="loadMore()"></ion-infinite-scroll>
  </ion-content>
</ion-view>


